import json

f=open('../data_new/total_data_raw_multichain.json','r')
content=f.read()
f.close()
total_data=json.loads(content)

print(type(total_data))

print(len(total_data))
total_data_raw_new=[]

for data_cctx_dict in total_data:
    # 获取源链目标链的名字
    # source_chain_name = data_cctx_dict["cross_chain_data"]["input"]["chain"]
    # target_chain_name = data_cctx_dict["cross_chain_data"]["output"]["chain"]


    # if source_chain_name in ["ETH","BSC","LTC","BTC","DOGE","AVAX","BCH"] and target_chain_name in ["ETH","BSC","LTC","BTC","DOGE","AVAX","BCH"]:
    #     data_cctx_dict["Type"]="1"
    #     total_data_raw_new.append(data_cctx_dict)
    data_cctx_dict["Type"] = "1"
    total_data_raw_new.append(data_cctx_dict)
print(f"全部数据抽取完成，最终总共{len(total_data_raw_new)}条数据")
json_data=json.dumps(total_data_raw_new,indent=4)
with open('../data_new/total_data_raw_tag_multichain.json', 'w', encoding='utf-8') as f:
    f.write(json_data)